<template>
  <div class="levelBox">
    <div class="level-box">
      <div v-for="level in (activityData.level_rewards || vipAssets)" :key="level.level" class="level-box-item"
        :class="{ 'check-bg': level.isChecked }">
        <div class="logo">
          <NuxtImg :src="level.image" :alt="level.name" />
          <div class="level-name">{{ level.name }}</div>
        </div>
        <div class="line-gray" :class="{ 'line-gray-check': level.isChecked }"
          :style="{ width: level.lineWidth, right: level.lineRight }"></div>
        <div class="point">
          <div :class="level.isChecked ? 'point-check' : 'point1'">
            <div v-if="!level.isChecked" class="point2"></div>
          </div>
        </div>
        <div class="nc_amount" :class="{ 'nc_amount-check': level.isChecked }">
          {{ level.upgrade_cond }}
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
defineProps(['activityData', 'vipAssets'])
</script>

<style scoped lang="scss">
.level-box {
  position: relative;
  margin-top: 0.5rem;
  display: flex;
  overflow-x: scroll;

  .level-box-item {
    width: 1.8rem;
    height: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-right: 0.2rem;
    position: relative;

    .logo {
      width: 1.5rem;
      height: 1.7rem;
      border-radius: 0.2rem;
      border: 0.03rem solid #65436F;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      background-color: #291632;

      &>img {
        width: 1rem;
        position: relative;
      }
    }

    .level-name {
      text-align: center;
      color: #8B6E8B;
      font-size: 0.3rem;
    }

    .line-gray {
      position: absolute;
      top: 2.1rem;
      width: 2rem;
      height: 1px;
      background: #543C65;

      &.line-gray-check {
        background: #FD66B1;
      }
    }

    .point {
      position: absolute;
      top: 1.94rem;
      width: 1.8rem;
      height: 0.34rem;

      .point-check {
        position: absolute;
        top: 50%;
        right: 50%;
        width: 0.166rem;
        height: 0.166rem;
        margin-top: -0.083rem;
        margin-right: -0.6rem;
        background: #FD66B1;
        border-radius: 0.2rem;
        z-index: 1;
      }
    }

    .nc_amount {
      position: absolute;
      top: 2.3rem;
      width: 1.5rem;
      height: 0.33rem;
      text-align: center;
      color: #7360B8;
      font-size: 0.3rem;

      &.nc_amount-check {
        color: #FD66B1;
        text-align: right;
      }
    }
  }

  .check-bg {
    .logo {
      background: linear-gradient(0deg, #6666FD 0%, #E23DFF 100%);
    }

    .level-name {
      color: #fff;
    }
  }
}
</style>
